package com.codejam.hello.world;

import com.codejam.hello.world.conf.TestConfBean;
import com.codejam.hello.world.conf.scope.TestScopeBean;
import com.codejam.hello.world.controller.TestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;

@ImportResource(locations = {"/config.xml"})
@SpringBootApplication
public class Application {

    @Autowired
    private TestController testController;



    public static void main(String[] args) {

        ConfigurableApplicationContext run = SpringApplication.run(Application.class, args);

        System.out.println("server startup done...");

        TestScopeBean bean = run.getBean(TestScopeBean.class);
        TestScopeBean bean2 = run.getBean(TestScopeBean.class);

        System.out.println(bean == bean2);

    }

}